Object and ErrorHandler Classes

To facilitate error reporting, every class in this package (except the error handler) is a subclass of the Object class. Every object knows how to print itself out, using the virtual function

void debug_out(ostream& c, int indent)
which prints out the contents of the object on output stream c. The printout is indented indent characters. The stream output operator ``«'' is also defined for objects.

The error handler (there is a single predefined instance of the error handler class, ``errh'', provided with the system) is used to print out error messages and terminate the program. Member functions for the handler are of the form

void ErrorExit(char* errloc, char* descript, Object& o1)
where errloc contains the function signature for where the error occurred, descript gives a description for the error, and o1 is an object that will have its contents printed out. Member functions accepting from zero to five objects are provided. A special class ErrVal is also provided, which allows scalar and integer values to be passed to the error handler as Objects. ErrVal constructors are
ErrVal(char* message, Scalar val)
ErrVal(char* message, int val)
which permit values to be tagged with an explanatory message. There is also a special class ErrType, which allows a value of an enumerated types described in Section [*] to be passed to the error handler as well. To construct an ErrType, the user specifies a message, the value of the enumerated type, and a key to what the enumerated type is:
ErrVal(char* message, int val, EnumSet s)